import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { StructureListVO, StructureListForm, StructureListQuery } from '@/api/system/structureList/types';

/**
 * 查询产品类型列表
 * @param query
 * @returns {*}
 */

export const listStructureList = (query?: StructureListQuery): AxiosPromise<StructureListVO[]> => {
  return request({
    url: '/system/structureList/list',
    method: 'get',
    params: query
  });
};
/**
 * 查询产品类型列表
 * @param query
 * @returns {*}
 */

export const listCorePvcWheelsList = (query?: StructureListQuery): AxiosPromise<StructureListVO[]> => {
  return request({
    url: '/system/corePvcWheels/selectList',
    method: 'get',
    params: query
  });
};
/**
 * 查询产品类型详细
 * @param id
 */
export const getStructureList = (id: string | number): AxiosPromise<StructureListVO> => {
  return request({
    url: '/system/structureList/' + id,
    method: 'get'
  });
};

/**
 * 新增产品类型
 * @param data
 */
export const addStructureList = (data: StructureListForm) => {
  return request({
    url: '/system/structureList',
    method: 'post',
    data: data
  });
};

/**
 * 修改产品类型
 * @param data
 */
export const updateStructureList = (data: StructureListForm) => {
  return request({
    url: '/system/structureList',
    method: 'put',
    data: data
  });
};

/**
 * 删除产品类型
 * @param id
 */
export const delStructureList = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/structureList/' + id,
    method: 'delete'
  });
};
